package escom.dds.modelo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "alumno")
public class Alumno implements Serializable {
	
	private Integer matricula;
	
	private String nombre;
	
	private String apPaterno;
	
	private String apMaterno;
	
	private Date fechaNac;
	
	private String calle;
	
	private String colonia; 
	
	private Integer numero;
	
	private Integer cp;
	
	private Character sexo;
	
	private String email;	
	
	private Integer idCarrera;
	
	private Carrera carrera;
	
	private List<Calificacion> calificaciones;
		
	@Id
	@Column(name = "matricula", nullable = false)
	public Integer getMatricula() {
		return matricula;
	}
	
	public void setMatricula(Integer matricula) {
		this.matricula = matricula;
	}
	
	@Column(name = "nombreAlumno", nullable = true)
	public String getNombre() {
		return nombre;
	}
	
	public void setNombre(String nombre) {
		this.nombre = nombre;
	}
	
	@Column(name = "apPaterno", nullable = true)
	public String getApPaterno() {
		return apPaterno;
	}
	
	public void setApPaterno(String apPaterno) {
		this.apPaterno = apPaterno;
	}
	
	@Column(name = "apMaterno", nullable = true)
	public String getApMaterno() {
		return apMaterno;
	}
	
	public void setApMaterno(String apMaterno) {
		this.apMaterno = apMaterno;
	}
	
	@Column(name = "fechaNac", nullable = true)
	public Date getFechaNac() {
		return fechaNac;
	}
	
	public void setFechaNac(Date fechaNac) {
		this.fechaNac = fechaNac;
	}
	
	@Column(name = "calle", nullable = true)
	public String getCalle() {
		return calle;
	}
	
	public void setCalle(String calle) {
		this.calle = calle;
	}
	
	@Column(name = "colonia", nullable = true)
	public String getColonia() {
		return colonia;
	}
	
	public void setColonia(String colonia) {
		this.colonia = colonia;
	}
	
	@Column(name = "numero", nullable = true)
	public Integer getNumero() {
		return numero;
	}
	
	public void setNumero(Integer numero) {
		this.numero = numero;
	}
	
	@Column(name = "cp", nullable = true)
	public Integer getCp() {
		return cp;
	}
	
	public void setCp(Integer cp) {
		this.cp = cp;
	}
	
	@Column(name = "sexo", nullable = true)
	public Character getSexo() {
		return sexo;
	}
	
	public void setSexo(Character sexo) {
		this.sexo = sexo;
	}
	
	@Column(name = "email", nullable = true)
	public String getEmail() {
		return email;
	}
	
	public void setEmail(String email) {
		this.email = email;
	}
	
	@Column(name = "idCarrera", nullable = true)
	public Integer getIdCarrera() {
		return idCarrera;
	}
	
	public void setIdCarrera(Integer idCarrera) {
		this.idCarrera = idCarrera;
	}
	
	@ManyToOne
	@JoinColumn(name = "idCarrera", referencedColumnName = "id", updatable = false, insertable = false)
	public Carrera getCarrera() {
		return carrera;
	}
	
	public void setCarrera(Carrera carrera) {
		this.carrera = carrera;
	}
	
	@OneToMany(mappedBy = "alumno")
	public List<Calificacion> getCalificaciones() {
		return calificaciones;
	}
	
	public void setCalificaciones(List<Calificacion> calificaciones) {
		this.calificaciones = calificaciones;
	}
}
